POV-Ray : Newsgroups : povray.newusers : Onion : Onion Server Time
28 Jul 2024 14:23:11 EDT (-0400)
  Onion  
From: Matija
Date: 15 Feb 2009 06:55:00
Message: <web.49980144c811732de30e02620@news.povray.org>
Hi!

I've been tryin to make somethign resembling an onion an cutting it away. Not
that I want it to look as an onion, just a bunch of concentric spheres. I
wanted to use the #while loop so that I wouldn't need to type much and could
change stuff easily. But only the first iteration seems to run OK, then it gets
weird. Could you please llok at my code, run it and help? Thanks!

Matija


  #include "colors.inc"
  #include "glass.inc"
  #include "skies.inc"
  #include "textures.inc"
    background{White}

    camera {
    angle 15
    location <3,12,10>
    look_at <0,0,0>
    }
    light_source { <12, 5, 3> color White }

#declare Stevec=1;
#declare Rad1 = 1;
#declare Rad2 = 0.1;

#declare Onion =

        #while (Stevec >= 0.2)
                #declare Rad1=Stevec;
                #declare Rad2=Rad1-0.1;
                difference {
                        sphere {<0,0,0>, Rad1}
                        sphere {<0,0,0>, Rad2 hollow} cutaway_textures}
                #declare Stevec=Stevec-0.2;

        #end

intersection {
         object {Onion pigment {color Green}}
        box {<0,-1,-1>
                <-1,1,1>
                pigment {color Blue}}
                }


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.